@value default-blue from 'canvas-editor/styles/theme';
@value default-gray from 'canvas-editor/styles/theme';
@value default-green from 'canvas-editor/styles/theme';

.ui-checkbox {
  border: 2px solid var(--gray, default-gray);
  border-radius: 50%;
  box-sizing: border-box;
  cursor: pointer;
  height: 1.125em;
  user-select: none;
  width: 1.125em;
}

.is-focused {
  border-color: var(--blue, default-blue);
}

.is-checked {
  animation: tick;
  animation-duration: 0;
  background-color: var(--green, default-green);
  background-image: url('/canvas-editor/images/checkmark.svg');
  background-size: 100%;
  border-color: var(--green, default-green);
}

.is-focused.is-checked {
  background-color: var(--blue, default-blue);
  border-color: var(--blue, default-blue);
}

.is-animateable {
  animation-duration: 0.5s;
}

@keyframes tick {
  from, 20%, 40%, 60%, 80%, to {
    animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
  }

  0% {
    opacity: 0;
    transform: scale3d(.3, .3, .3);
  }

  20% {
    transform: scale3d(1.1, 1.1, 1.1);
  }

  40% {
    transform: scale3d(.9, .9, .9);
  }

  60% {
    opacity: 1;
    transform: scale3d(1.03, 1.03, 1.03);
  }

  80% {
    transform: scale3d(.97, .97, .97);
  }

  to {
    opacity: 1;
    transform: scale3d(1, 1, 1);
  }
}
